#!/usr/bin/python3
# -*- coding:utf-8 -*-
"""
@author: henry_oulen@163.com
@file: model_utils.py
@time: 2023/10/26 18:31
@desc: 
"""

import time
from sqlalchemy import Column, Integer, String, DateTime, Boolean, Float, BigInteger

from backend.tvadmin.utils.mysql_base import MysqlBase


class ModelBase(MysqlBase):
    company_id = Column(Integer, default=0, nullable=True, comment="公司id")
    id = Column(BigInteger, primary_key=True, comment="Id")
    description = Column(String(255), nullable=True, comment="描述")
    creator_id = Column(BigInteger, nullable=True, comment="创建人id")
    creator_name = Column(String(32), nullable=True, comment="创建人姓名")
    modifier_id = Column(BigInteger, nullable=True, comment="修改人id")
    modifier_name = Column(String(32), nullable=True, comment="修改人姓名")
    dept_belong_id = Column(String(32), nullable=True, comment="数据归属部门")
    update_datetime = Column(BigInteger, nullable=True, comment="更新时间", default=lambda: int(time.time()))
    create_datetime = Column(BigInteger, nullable=True, comment="创建时间", default=lambda: int(time.time()))
    delete_datetime = Column(BigInteger, nullable=True, comment="删除时间")
    is_delete = Column(Integer, default=0, nullable=True, comment="0未删除 1已删除")
